package com.infore.siteManagement.controller.equipment;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.infore.siteManagement.entity.equipment.EquipReagent;
import com.infore.siteManagement.select.dto.QueryParamDto;
import com.infore.siteManagement.service.equipment.IEquipReagentService;
import com.infore.siteManagement.util.ResultEntity;

@Api(value = "试剂管理接口", tags = { "试剂管理接口" })
@RestController
@RequestMapping("/equipReagent")
public class EquipReagentController {

	@Autowired
	private IEquipReagentService iEquipReagentService;

	@ApiOperation(value = "查询试剂通用接口")
	@ResponseBody
	@PostMapping(value = "/query")
	public ResultEntity query(@RequestBody(required = false) QueryParamDto queryParamDto) {
		return iEquipReagentService.query(queryParamDto);
	}

	@ApiOperation(value = "删除试剂通用接口")
	@ApiImplicitParams(@ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true, dataType = "String"))
	@DeleteMapping(value = "/delete")
	public ResultEntity delete(String id) {
		return iEquipReagentService.delete(id);
	}

	@ApiOperation(value = "编辑/新增试剂通用接口")
	@ResponseBody
	@PostMapping(value = "/edit")
	public ResultEntity edit(@RequestBody EquipReagent equipReagent) {
		return iEquipReagentService.edit(equipReagent);
	}
}
